# coding=utf8
import os

from export_excel.txt_export_excel import TxtExportExcel


# filename = "C:/Users/rui.tian/PycharmProjects/untitled2/fengjr_pycrawler_research/spider_vip/task/category_all.task"
# excelname = "C:/Users/rui.tian/PycharmProjects/untitled2/fengjr_pycrawler_research/spider_vip/task/category_all.xlsx"

# page = TxtExportExcel(filename, excel_name=excelname)
# page.start(keys=[
#     "url", "attrs.category",
#     "attrs.category1", "attrs.category2", "attrs.category3",
#     "attrs.category1_id", "attrs.category2_id", "attrs.category3_id",
# ])


# filename = "C:/Users/rui.tian/Desktop/jdlist_id/jdlist_id_32112.log.2018-11-12"
# excelname = "C:/Users/rui.tian/Desktop/jdlist_id/jdlist_id_32112.log.2018-11-12.xlsx"
#
# page = TxtExportExcel(filename, excel_name=excelname)
# page.start(keys=[
#     "pid", "batch", "time", "result.url",
# ])


filename = []

# filename = "C:/Users/rui.tian/Desktop/jdnumerical_132892.log.2018-12-10"
# excelname = "C:/Users/rui.tian/Desktop/jdnumerical_132892.xlsx"
# filename = "C:/Users/rui.tian/Desktop/jdnumerical2.txt"
# excelname = "C:/Users/rui.tian/Desktop/jdnumerical2.xlsx"

path = "C:/Users/rui.tian/Desktop/jdinfo_temp"
excelname = "C:/Users/rui.tian/Desktop/jdinfo_temp.xlsx"
for filei in os.listdir(path):
    filename.append(path + "/" + filei)

page = TxtExportExcel(*filename, excel_name=excelname)
page.start(
    # keys=["pid", "batch", "time", "result.url"]
)
